package com.fourth.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.sql.Timestamp;

import com.fourth.annotion.ValidateEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author 曹金波
 * @since 2022-08-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("tb_user")
@ApiModel(value="User对象", description="用户表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户id")
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;
    @ValidateEntity(required=true,requiredLeng=true,
            minLength=2,maxLength=8,
            errorRequiredMsg="用户名不能为空!",
            errorMinLengthMsg="用户名长度需大于2!",
            errorMaxLengthMsg="用户名长度不能大于8!")

    @ApiModelProperty(value = "用户名")
    private String userName;

    @ValidateEntity(required=true,requiredLeng=true,
            minLength=18,maxLength=18,
            errorRequiredMsg="身份证不能为空!",
            errorMinLengthMsg="身份证只能为18位!",
            errorMaxLengthMsg="身份证只能为18位!")
    @ApiModelProperty(value = "身份证号")
    private String userIdCard;

    @ValidateEntity(required=true,requiredLeng=true,
            minLength=11,maxLength=11,
            errorRequiredMsg="手机号码不能为空!",
            errorMinLengthMsg="手机号码只能为11位!",
            errorMaxLengthMsg="手机号码只能为11位!")
    @ApiModelProperty(value = "手机号码")
    private String userPhone;

    @ApiModelProperty(value = "邮箱")
    private String userEmail;

    @ApiModelProperty(value = "地址")
    private String userAddress;

    @ApiModelProperty(value = "账户余额")
    private BigDecimal balance;

    @ValidateEntity(required=true,requiredLeng=true,
            minLength=6,maxLength=16,
            errorRequiredMsg="登录密码不能为空!",
            errorMinLengthMsg="登录密码长度需大于6!",
            errorMaxLengthMsg="用户名长度不能大于16!")
    @ApiModelProperty(value = "登录密码 md5加密")
    private String userPassword;

    @ValidateEntity(required=true,requiredLeng=true,
            minLength=6,maxLength=6,
            errorRequiredMsg="支付密码不能为空!",
            errorMinLengthMsg="支付密码只能为6位!",
            errorMaxLengthMsg="支付密码只能为6位!")
    @ApiModelProperty(value = "支付密码 md5加密")
    private String userPayPassword;

    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;


}
